Update error message with more details.
authorStephen Becker IV <github@deathbyescalator.com>
Sat, 16 May 2015 19:39:48 +0000 (12:39 -0700)
committerStephen Becker IV <github@deathbyescalator.com>
Sat, 16 May 2015 19:39:48 +0000 (12:39 -0700)
This resolves #1379.

src/cargo/util/toml.rs
tests/test_cargo_compile.rs
tests/test_cargo_compile_custom_build.rs

index 35450030ebd04df48308bf52f2eccafeacc318d7..5cbefe5662c642e44e8496fda8a9117e35694f67 100644 (file)
@@ -118,8 +118,8 @@ pub fn to_manifest(contents: &[u8],
         None => {}
     }
     if !manifest.targets().iter().any(|t| !t.is_custom_build()) {
-        return Err(human(format!("either a [lib] or [[bin]] section must \
-                                  be present")))
+        return Err(human(format!("either a [lib] (lib.rs) or [[bin]] (main.rs) section must \
+                                  be present in src")))
     }
     return Ok((manifest, paths));
 
index 42e563855c5ba583dc60800f947c90eb65ea65c9..aa18699dcf004d2f47152d7792d9acf3cf2088ce 100644 (file)
@@ -794,7 +794,7 @@ test!(missing_lib_and_bin {
 failed to parse manifest at `[..]Cargo.toml`
 
 Caused by:
-  either a [lib] or [[bin]] section must be present\n"));
+  either a [lib] (lib.rs) or [[bin]] (main.rs) section must be present in src\n"));
 });
 
 test!(lto_build {
index ce2de60950531538fcc00f342e6949b68ffaa9bc..51d1843306e8ab7a6c0e15833ef1d785d0226fc0 100644 (file)
@@ -953,7 +953,7 @@ test!(build_script_only {
 failed to parse manifest at `[..]`
 
 Caused by:
-  either a [lib] or [[bin]] section must be present"));
+  either a [lib] (lib.rs) or [[bin]] (main.rs) section must be present in src"));
 });
 
 test!(shared_dep_with_a_build_script {